Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: experimental $sql() method for LazyFrame and DataFrame #1065

Merged
merged 5 commits into from
Apr 28, 2024
Merged

Conversation

eitsupi
Copy link
Collaborator

@eitsupi eitsupi commented Apr 28, 2024

@eitsupi
Copy link
Collaborator Author

eitsupi commented Apr 28, 2024

Hmmm, there seems to be errors in building the website.
Perhaps a problem with the < escaping process?

@eitsupi
Copy link
Collaborator Author

eitsupi commented Apr 28, 2024

I checked altdoc:::.rd2qmd("man/DataFrame_sql.Rd", ".", ".").
The output qmd file has this:

# Apply transformations to a DataFrame using SQL, aliasing "self" to "frame".
df1$sql(
  query = r"(
SELECT
a,
(a \% 2 == 0) AS a_is_even,
CONCAT_WS(':', b, b) AS b_b,
EXTRACT(year FROM c) AS year,
0::float AS 'zero'
FROM frame
)",
  table_name = "frame"
)

\% should be replaced to %.

@eitsupi

This comment was marked as resolved.

@eitsupi

This comment was marked as resolved.

@eitsupi
Copy link
Collaborator Author

eitsupi commented Apr 28, 2024

Apparently this is a bug in roxygen2. The following Rd file is fine, so no % escaping is needed here.

\examples{
a <- "\%"
b <- "
%
"
c <- r"(
%
)"
}

I opened an issue r-lib/roxygen2#1616

@eitsupi
Copy link
Collaborator Author

eitsupi commented Apr 28, 2024

For now, we can use MOD(x, 2) instead of x % 2 to avoid using % in examples.

@eitsupi
Copy link
Collaborator Author

eitsupi commented Apr 28, 2024

This is a new experimental method addition that does not affect existing code.
So merging.

@eitsupi eitsupi merged commit bb3b753 into main Apr 28, 2024
17 of 19 checks passed
@eitsupi eitsupi deleted the frame-sql branch April 28, 2024 06:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant